<?php
    include('./config.php');
    include('./request.php');
    $username = $result->username;
    $userphone = $result->userphone;
    $useremail = $result->useremail;
    try{
        $pdo = new PDO($dsn,$user,$pass);
        $sql = "update user set user_name='".$username."',user_phone='".$userphone."',user_email='".$useremail."' where user_name='".$username."'";
        $res = $pdo->prepare($sql);
        $res->execute();
        if($res){
            echo "ok";
        }else{
            echo "error";
        }
    }catch(PDOException $e){
        echo "保存失败了，请重新提交";
        }
?>